<template>
  <div class="throttling">
    <Button @click="addNum" type="primary">增加</Button>
    <div>
      <div>疯狂点击也是每秒 + 1</div>
      <div>{{ count }}</div>
    </div>
  </div>
</template>

<script>
import { throttle } from "@/utils/common.js";

export default {
  data() {
    return {
      count: 0
    };
  },
  methods: {
    addNum: throttle(function() {
      this.count++;
    }, 1000)
  }
};
</script>
